package cn.zjutleo.village_server.controller;

import cn.zjutleo.village_server.entity.Department;
import cn.zjutleo.village_server.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

/**
 * @Author: 张坤
 * @DateTime: 2021/8/30 22:19
 * @Description: 该类用于 TODO
 */
@Api(tags = "部门信息信息查询")
@RestController()
public class DepartmentController {
    @Autowired
    DepartmentService departmentService;

    @ApiOperation("通过村庄id查询部门")
    @PostMapping("/api/getDepartmentInfoById")
    List<Department> getDepartmentInfoById(@RequestBody HashMap<String ,String > map){
        return departmentService.searchDepartmentById(Integer.valueOf(map.get("d_village_id")));
    }
}
